feat: iOS simulator (arm64) support#9893
Conversation
|
Thank you for the contribution! I'm a bit preoccupied at the moment, but this is on my radar and I will try my best to review this by the end of the week. |
bejado
left a comment
There was a problem hiding this comment.
So far everything looks good!
I notice that when building, we leave intermediate .a static libraries inside out/ios-debug/filament/lib/arm64-iphoneos, out/ios-debug/filament/lib/arm64-iphonesimulator, out/ios-debug/filament/lib/universal, etc.
When we create an archive (running ./build.sh with the -a flag), these intermediate folders get packaged into the .tgz along with the final .xcframework outputs, which is unnecessary and will bloat the size of the archive. We should think of a way to either exclude them from the final archive or remove them after XCFramework creation.
Also, as a minor aside: libs/imagediff/CMakeLists.txt installs into a generic lib/arm64 folder because it references ${DIST_ARCH} rather than ${DIST_DIR}. This is another intermediate product that stays behind in the archive.
|
Thanks for the comments! I’ll be busy until Friday, but I’ll make sure to improve this by the end of the week. Thanks again! |
- Generalized framework paths in project.yml files using a dynamic FILAMENT_OUT_NAME build setting. - Updated build-resources.sh and build-materials.sh to use the -L flag with find. This ensures that symlinked Filament host tools are correctly resolved during asset compilation.
- Patched the Metal backend in MetalDriver.mm to disable Depth Clip Mode on iOS Simulator. This resolves the MTLValidateFeatureSupport assertion failure on unsupported hardware/runtimes.
62829a6 to
e75192a
Compare
|
Thanks for the review, both issues are fixed in the latest commit.
Let me know if anything else needs tweaking. |
|
I can tell this is a more than welcome feature. Developing on a Having I tested on my side: Tahoe 26.2 on M2 Pro. Xcode 26.0.1. iPhone 16e, iPhone 17, iPhone SE (3rd gen) simulators running iOS 26.0. ✅ All good 👌
I also checked with filament [feat/ios-simulator-support●] % lipo out/ios-release/filament/lib/libbackend.xcframework/ios-arm64_x86_64-simulator/libbackend.a \
-thin arm64 -output /tmp/sim-arm64.a
filament [feat/ios-simulator-support●] % cd /tmp && ar -x sim-arm64.a BackendUtils.cpp.o
/tmp % vtool -show /tmp/BackendUtils.cpp.o | grep platform
platform IOSSIMULATORAll good 👌 Thanks a lot @Erkko68 for resuming this effort 🙏 @bejado do you see this landing soon? 🤞 Regards |
bejado
left a comment
There was a problem hiding this comment.
Looks good to me 👍 Thanks @Erkko68 for the effort and @xseignard for helping verify!
|
The
XcodeGen 2.45.3 doesn't honor I'd suggest bumping the iOS CI jobs to Xcode 16.2 to unblock this — Xcode 16 shipped September 2024, Apple has required it for App Store submissions since April 2025, the Proposed changes (pushed for review):
Let me know if you'd like any of this adjusted before merging. |
|
I'd even bump to Xcode 26 (in another PR 😅) since it's required since yesterday to build with it to publish apps on the AppStore. |
| - FilamentApp | ||
| dependencies: | ||
| - sdk: ARKit.framework | ||
| dependencies: |
There was a problem hiding this comment.
praise: good catch 🦅 👁️ ARKit.framework was silently dropped because of the dependencies block redefinition
There was a problem hiding this comment.
Of course there had to be one last bug! Now it looks good to go 😂
|
Thanks for merging @bejado 🙏 |
Apologies for the delay, the CocoaPods publishing process has been giving us some trouble; even running it locally it occasionally times out. I just pushed Filament 1.71.2 to CocoaPods. Our releases are delayed 1-2 weeks, but looks like this arm64 simulator PR will make it into next week's release. |

This PR completes iOS simulator (ARM64) support and the XCFramework migration, following up on feedback from Pull Request #7704 which appears to be inactive.
It removes remaining assumptions about build configurations, finalizes XCFramework usage across samples, and addresses a simulator-specific runtime issue.
Changes
Build configuration
$(FILAMENT_OUT_NAME)inapp-template.ymlios-debug/ios-releasebased on the active Xcode configurationios-releasepaths noted in feat: Add builds for iOS Silicon Simulator #7704XCFramework migration
app-template.ymland allios/samples/*/project.ymlMetal (iOS simulator)
During testing, running sample apps on the simulator triggered the following assertion:
To address this:
supportsDepthClampwith#if !TARGET_OS_SIMULATORinMetalDriver.mmThis avoids the crash on simulator builds. If there is a preferred configuration-based solution that avoids modifying source code, I’m happy to update accordingly.
Testing
xcodegengltf-viewerand other samples on ARM64 simulatorNotes
I’m not deeply familiar with the internals of Filament, but I’ve been using this setup over the past few weeks to run and test personal projects on ARM64 simulators.
This PR is mainly an attempt to address the gaps left in #7704 and get to a working, configuration-safe setup for simulator builds.
If there are better approaches or changes needed to match the project’s standards, I’m happy to iterate on this.